package com.demo.boot.listener;

import lombok.Getter;
import lombok.Setter;
import org.springframework.context.ApplicationEvent;

/**
 *
 * 观察者模式
 * spring的事件监听有三个部分组成，事件（ApplicationEvent)、监听器(ApplicationListener)和事件发布操作。
 * 实践类集成ApplicationEvent
 *
 *  https://www.cnblogs.com/itplay/p/10982072.html
 * @date 21-6-13 8:42
 * @author ccubee
 */
@Setter
@Getter
public class MyEvent extends ApplicationEvent {
	private static final long serialVersionUID = 1L;
	private String data;
 
	public MyEvent(Object source, String data) {
		super(source);
		this.data = data;
	}

}